<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

</head>
<body>
<form method="POST" enctype="multipart/form-data" action="/music/upload">
    文件上传：<input type="file" name="file" id="file"/></br>
    歌手名: <label><input type="text" name="singer" id="singer" placeholder="请输入歌手名"/></label></br>
    <input type="submit" value="上传"/>
</form>

<!-- 文件上传：<input type="file" name="file" id="file"/></br>
歌手名: <label><input type="text" name="singer" id="singer" placeholder="请输入歌手名"/></label></br>
<button type="button" onclick="upload()">上传</button>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script>
    function upload() {
        $.ajax({
            type: "post",
            url: "/music/upload",
            data: {
                file: $("#file").val(),
                singer: $("#singer").val()
            },
            success: function(result){
                if(result.data) {
                    //添加成功
                    alert("添加成功");
                    location.href = "list.html";
                }else {
                    alert(result.message);
                }
            }
        });
    }
</script> -->
</body>
</html>